package com.aishua.fire.common.eenum;

import lombok.extern.slf4j.Slf4j;

/**
 * 白名单接口列表
 * @author Administrator
 *
 */
@Slf4j
public enum OneLevelMenuEnum {

	
	
	/** 配置菜单 **/
	DEFAULT(null,null,null,null),
	HOME("首页","0","/welcome","0"),
	SYS_Manager("系统管理","0",null,"1");
	

	/** 一级菜单名**/
	private String oneLevelMenuName;
	/** 菜单类型 **/
	private String menuType;
	/** 路由url **/
	private String routeUrl;
	/** 序号 **/
	private String orderNum;
	
	private OneLevelMenuEnum(String oneLevelMenuName, String menuType, String routeUrl, String orderNum) {
		this.oneLevelMenuName = oneLevelMenuName;
		this.menuType = menuType;
		this.routeUrl = routeUrl;
		this.orderNum = orderNum;
	}

	public String getOneLevelMenuName() {
		return oneLevelMenuName;
	}

	public void setOneLevelMenuName(String oneLevelMenuName) {
		this.oneLevelMenuName = oneLevelMenuName;
	}

	public String getMenuType() {
		return menuType;
	}

	public void setMenuType(String menuType) {
		this.menuType = menuType;
	}

	public String getRouteUrl() {
		return routeUrl;
	}

	public void setRouteUrl(String routeUrl) {
		this.routeUrl = routeUrl;
	}

	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}

	public static OneLevelMenuEnum getByMenuName(String menuName) {
		for(OneLevelMenuEnum oneLevelMenuEnum : values()) {
			if(oneLevelMenuEnum.getOneLevelMenuName().equals(menuName)) {
				return oneLevelMenuEnum;
			}
		}
		log.warn("存在未配置的菜单:{}",menuName);
		return null;
	}
}
